Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre and post fields for overriding ToC heading #8643

Closed
wants to merge 2 commits into from

Conversation

IveGotNorto
Copy link
Contributor

Pre and post allow users to add semantically correct headings to ToC
without breaking existing functionality.

See #8338

@CLAassistant
Copy link

CLAassistant commented Jun 15, 2021

CLA assistant check
All committers have signed the CLA.

@jmooring
Copy link
Member

jmooring commented Jun 15, 2021

@IveGotNorto

I pulled this locally for some quick testing. Comments...

  • If pre is not defined in the site configuration, its value should be <nav id="TableOfContents">

  • If post is not defined in the site configuration, its value should be </nav>

  • I should be able to override pre independently of post. For example:

    [markup]
      [markup.tableOfContents]
        pre = "<nav><h1>Navigation</h1>"
  • I should be able to override post independently of pre. For example:

    [markup]
      [markup.tableOfContents]
        post = "</nav><!-- end of nav -->"
  • If pre = "" in the site configuration, the outer <ol> or <ul> should not be preceded by anything (i.e., do not insert <nav id="TableOfContents">).

  • If post = "" in the site configuration, the outer </ol> or </ul> should not be followed by anything (i.e., do not insert </nav>).

@jmooring
Copy link
Member

@IveGotNorto Thank you for working on this!

@jmooring
Copy link
Member

@IveGotNorto

Although this is working as intended, the defaults for pre and post should not be nil.
https://github.com/gohugoio/hugo/pull/8643/files#diff-be327cc7b6df56b7b25c4775d78955598913504707bd422132aec74e1b5ffc39R169-R170

The defaults should be <nav id="TableOfContents"> and </nav>.

Pre and post allow users to add semantically correct
headings to ToC without breaking existing functionality.

See gohugoio#8338
@bep
Copy link
Member

bep commented Jun 19, 2021

See #8670

@IveGotNorto
Copy link
Contributor Author

Not really sure where this PR stands. Should I be making some different changes related to #8670? @bep @jmooring

@jmooring
Copy link
Member

I wanted to revist this today to test your changes, but it no longer builds due to a7e3da2.

I cannot answer your question about where this PR stands in relation to #8670 and #8680. It seems like we're in a holding pattern.

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
Please check https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md#code-contribution and verify that this code contribution fits with the description. If yes, tell is in a comment.
This PR will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Jan 16, 2022
@github-actions github-actions bot closed this Feb 18, 2022
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants